#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<string>
#include<vector>
#include<stdlib.h>
#include<iostream>
#define MAX 10000
int test(int n,int cishu){cishu++;
	if (cishu>MAX){
		return -1;
	}
	if (n==1){
		return cishu;
	}
	if(n%2==1){
		return test(3*n+1,cishu);
	}
	else{
		return test(n/2,cishu);
	}
	
}
int main(){
	int x;
	int y[1000]; 
	scanf("%d",&x);
	for (int i=0;i<x;i++){
		scanf("%d",&y[i]);
	}
	for(int i=0;i<x;i++){
		printf("%d\n",test(y[i],-1));
	}
	
}